// @ts-ignore
/* eslint-disable */
import { request } from '@umijs/max';

/** 添加轮播图 */
export async function mjBannerAdd(options) {
  return request<{
    data;
  }>('/api/mjBanner/add', {
    method: 'POST',
    ...(options || {}),
  });
}

/** 删除轮播图 */
export async function currentUser(options) {
    return request<{
      data;
    }>('/api/mjBanner/add', {
      method: 'POST',
      ...(options || {}),
    });
  }
  
  /** 轮播图列表 */
export async function mjBannerQuery(options) {
    return request<{
      data;
    }>('/api/mjBanner/queryByPage', {
      method: 'POST',
      ...(options || {}),
    });
  }

/** 退出登录接口 POST /api/login/outLogin */
export async function outLogin(options?: { [key: string]: any }) {
  return request<Record<string, any>>('/api/login/outLogin', {
    method: 'POST',
    ...(options || {}),
  });
}

/** 登录接口 POST /api/login/account */
export async function login(body: API.LoginParams, options?: { [key: string]: any }) {
  return request<API.LoginResult>('/api/login', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}

/** 添加网站基本信息 */
export async function pageAdd(options) {
  return request<{
    data;
  }>('/api/homepage/add', {
    method: 'POST',
    data:(options || {}),
  });
}

/** 删除网站基本信息 */
export async function pageRemove(options) {
    return request<{
      data;
    }>('/api/homepage/delete', {
      method: 'POST',
      params:(options || {}),
    });
  }
  
  /** 网站基本信息列表 */
export async function pageQuery(options) {
    return request<{
      data;
    }>('/api/homepage/queryByPage', {
      method: 'POST',
      data: (options || {}),
    });
  }
  /**更新 */
  export async function updatepageQuery(options) {
    console.log(options)
    return request<{
      data;
    }>('/api/homepage/edit', {
      method: 'POST',
      data:(options || {}),
    });
  }
  
  export async function editSubtitle(options?: { [key: string]: any }) {
    return request<{
      data;
    }>('/api/homepage/editSubtitle', {
      method: 'POST',
      data:{...options},
    });
  }
  
  
  
  /** 添加网站底部信息 */
export async function newPageAdd(options) {
  return request<{
    data;
  }>('/api/mjBasicInfo/add', {
    method: 'POST',
    data:(options || {}),
  });
}

/** 删除网站底部信息 */
export async function newPageRemove(options) {
    return request<{
      data;
    }>('/api/mjBasicInfo/delete', {
      method: 'POST',
      params:(options || {}),
    });
  }
  
  /** 网址底部信息列表 */
export async function newPageQuery(options) {
    const result = await request<{
      data;
    }>('/api/mjBasicInfo/queryByPage', {
      method: 'POST',
      data: (options || {}),
    });
    return {
      data:result.data.records,
      success:true,
      total:result.data.total
    }
  }
  /**更新 */
  export async function newPageUpdate(options) {
    console.log(options)
    return request<{
      data;
    }>('/api/mjBasicInfo/edit', {
      method: 'POST',
      data:(options || {}),
    });
  }

  //删除
  export async function newPageDelete(options) {
    return request<{
      data;
    }>('/api/mjBasicInfo/delete', {
      method: 'POST',
      params:{id:options},
    });
  }

  
  